from rest_framework import serializers
from .models import ProductionDeployRecord


class ProductionDeployRecordDetail(serializers.ModelSerializer):
    '''获取部署记录'''

    update_time = serializers.DateTimeField(format="%Y-%m-%d %H:%M:%S")
    create_time = serializers.DateTimeField(format="%Y-%m-%d %H:%M:%S")

    class Meta:
        model = ProductionDeployRecord
        fields = "__all__"


# 测试用
class ProductionDeployRecordCreate(serializers.ModelSerializer):

    class Meta:
        model = ProductionDeployRecord
        fields = ("name", "env", "tag")